from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search


class DSLSearch(object):

    def __init__(self):
        self.es = Elasticsearch("112.74.185.44:9200")
        self.dsl = Search(using=self.es)

    def query(self):
        s = self.dsl.query("match", title="Chinese")
        responese = s.execute()
        for hit in s:
            print(hit)


dslsearch = DSLSearch()
dslsearch.query()
